layui.config({
    base: "/js/modules/"
}).extend({
    "listView": "listView"
});
layui.use(['form', 'listView', 'laydate', 'jquery', 'common'], function () {
    let layDate = layui.laydate,
        form = layui.form,
        common = layui.common,
        layer = layui.layer,
        $ = layui.$;
    layDate.render({elem: "#beginTime", type: 'datetime', trigger: 'click'});
    layDate.render({elem: "#endTime", type: 'datetime', trigger: 'click'});
    layDate.render({elem: "#beginTimeGroup1", type: 'datetime', trigger: 'click'});
    layDate.render({elem: "#endTimeGroup1", type: 'datetime', trigger: 'click'});
    layui.listView.tableInit({
        id: 'warnInfo',
        url: 'info/page',
        page: true,
        cols: [
            {field: 'number', title: '序号', fixed: 'true', type: 'numbers'},
            {field: 'typeName', title: '设备类型'},
            {field: 'goodsName', title: '设备名称'},
            {field: 'location', title: '设备位置'},
            {field: 'deviceId', title: '设备编号'},
            /*{field: 'warnBeginTime', title: '告警开始时间'},
            {field: 'warnEndTime', title: '告警结束时间'},*/
            {field: 'duration', title: '持续时间(秒)'},
            {field: 'hitRuleId', title: '告警规则'},
            {field: 'paramName', title: '告警参数'},
            {field: 'warnValue', title: '告警值'},
            {field: 'minValue', title: '最小值'},
            {field: 'maxValue', title: '最大值'}
        ]
    });

    $('#add').on('click', function () {
        layer.open({
            title: '新增用户',
            type: 2,
            area: ['1000px', '340px'],
            fixed: false, //不固定
            maxmin: true,
            content: 'toAddUser'
        });
    });

});
